package market

import (
	"context"
	"git.900sui.cn/kc/rpcinterface/client"
	"git.900sui.cn/kc/rpcinterface/interface/market"
)

type GroupBooking struct {
	client.Baseclient
}

func (g *GroupBooking) Init() *GroupBooking {
	g.ServiceName = "rpc_market"
	g.ServicePath = "GroupBooking"
	return g
}

//获取总店现有的营销工具，如果数据不存在就插入一条默认的数据
func (g *GroupBooking) GetBusMarketTool(ctx context.Context, busId *int, reply *market.ReplyGetBusMarketTool) error {
	return g.Call(ctx, "GetBusMarketTool", busId, reply)
}

//总店更改指定营销工具的状态
func (g *GroupBooking) BusChangeMarketSwitch(ctx context.Context, args *market.ArgsBusChangeMarketSwitch, reply *bool) error {
	return g.Call(ctx, "BusChangeMarketSwitch", args, reply)
}

//新建AI拼团
func (g *GroupBooking) AddNewGroup(ctx context.Context, args *market.ArgsAddNewGroup, reply *bool) error {
	return g.Call(ctx, "AddNewGroup", args, reply)
}

//编辑AI拼团
func (g *GroupBooking) EditGroup(ctx context.Context, args *market.ArgsEditGroup, reply *bool) error {
	return g.Call(ctx, "EditGroup", args, reply)
}

//总店结束AI拼团
func (g *GroupBooking) BusFinishGroup(ctx context.Context, args *market.ArgsBusFinishGroup, reply *bool) error {
	return g.Call(ctx, "BusFinishGroup", args, reply)
}

//总店删除AI拼团
func (g *GroupBooking) BusDeleteGroup(ctx context.Context, args *market.ArgsBusDeleteGroup, reply *bool) error {
	return g.Call(ctx, "BusDeleteGroup", args, reply)
}

//获取AI拼团详情
func (g *GroupBooking) GetGroupInfo(ctx context.Context, args *market.ArgsGetGroupInfo, reply *market.ReplyGetGroupInfo) error {
	return g.Call(ctx, "GetGroupInfo", args, reply)
}

//总店/分店AI拼团列表
func (g *GroupBooking) GetGroupLists(ctx context.Context, args *market.ArgsGetGroupLists, reply *market.ReplyGetGroupLists) error {
	return g.Call(ctx, "GetGroupLists", args, reply)
}

// 预付卡详情中拼团列表
func (g *GroupBooking) GetPrepaidCardInfoLists(ctx context.Context, args *market.ArgsPrepaidCardInfoLists, reply *market.ReplyPrepaidCardInfoLists) error {
	return g.Call(ctx, "GetPrepaidCardInfoLists", args, reply)
}

//定时自动更新拼团活动状态：未开始->进行中；进行中->已结束
func (g *GroupBooking) AutoUpdateGroupStatusRpc(ctx context.Context, args *market.ArgsAutoUpdateGroupStatusRpc, reply *market.ReplyAutoUpdateGroupStatusRpc) error {
	return g.Call(ctx, "AutoUpdateGroupStatusRpc", args, reply)
}

////获取App首页拼团项目详情
//func (g *GroupBooking) GetAppGroupSingleInfo(ctx context.Context, args *market.ArgsGetAppGroupSingleInfo, reply *market.ReplyGetAppGroupSingleInfo) error {
//	return g.Call(ctx, "GetAppGroupSingleInfo", args, reply)
//}

//获取App首页拼团卡项/项目详情
func (g *GroupBooking) GetAppGroupItemInfo(ctx context.Context, args *market.ArgsGetAppGroupItemInfo, reply *market.ReplyGetAppGroupItemInfo) error {
	return g.Call(ctx, "GetAppGroupItemInfo", args, reply)
}

// 参加团
func (g *GroupBooking) JoinGroup(ctx context.Context, args *market.ArgsJoinGroup, reply *market.ReplyJoinGroup) error {
	return g.Call(ctx, "JoinGroup", args, reply)
}

//拼团活动-适用门店
func (g *GroupBooking) GetGroupApplyShops(ctx context.Context, args *market.ArgsGetGroupApplyShops, reply *market.ReplyGetGroupApplyShops) error {
	return g.Call(ctx, "GetGroupApplyShops", args, reply)
}

//获取用户的AI拼团列表
func (g *GroupBooking) GetUserJoinGroupLists(ctx context.Context, args *market.ArgsGetUserJoinGroupLists, reply *market.ReplyGetUserJoinGroupLists) error {
	return g.Call(ctx, "GetUserJoinGroupLists", args, reply)
}

// APP拼团列表
func (g *GroupBooking) GetAppUserGroupLists(ctx context.Context, args *market.ArgsUserGetGroupLists, reply *market.ReplyUserGetGroupLists) error {
	return g.Call(ctx, "GetAppUserGroupLists", args, reply)
}

//判断卡项详情是否加入了AI拼团活动
func (g *GroupBooking) ItemInfoIsJoinGroup(ctx context.Context, args *market.ArgsItemInfoIsJoinGroup, reply *bool) error {
	return g.Call(ctx, "ItemInfoIsJoinGroup", args, reply)
}

//获取活动产品详情-用户待成团列表
func (g *GroupBooking) GetUserWaitGroupLists(ctx context.Context, args *market.ArgsGetUserWaitGroupLists, reply *market.ReplyGetUserWaitGroupLists) error {
	return g.Call(ctx, "GetUserWaitGroupLists", args, reply)
}

//获取参团详情
func (g *GroupBooking) GetOfferedInfo(ctx context.Context, args *market.ArgsGetOfferedInfo, reply *market.ReplyGetOfferedInfo) error {
	return g.Call(ctx, "GetOfferedInfo", args, reply)
}

// 定时自动更新待成团订单状态：有效期结束后后自动更改拼团状态为已完成
func (g *GroupBooking) AutoUpdateOfferedStatusRpc(ctx context.Context, args int, reply *bool) error {
	return g.Call(ctx, "AutoUpdateOfferedStatusRpc", args, reply)
}

//获取门店内所有待成团的活动
func (g *GroupBooking) GetShopAllWaitGroupLists(ctx context.Context, args *market.ArgsGetShopAllWaitGroupLists, reply *market.ReplyGetShopAllWaitGroupLists) error {
	return g.Call(ctx, "GetShopAllWaitGroupLists", args, reply)
}

//拼团-购买单项目/卡项时检查数据有效性&&获取拼团所需的基础信息
//（主要校验：是否超出限购，是否超出活动库存，是否适用当前门店，参团是否有所限制，是否在规定的活动日期之内）
func (g *GroupBooking) CheckAndGetGroupItemInfoRpc(ctx context.Context, args *market.ArgsCheckAndGetGroupItemInfo, reply *market.ReplyCheckAndGetGroupItemInfo) error {
	return g.Call(ctx, "CheckAndGetGroupItemInfoRpc", args, reply)
}

//删除单项目的时候需要校验是否有未结束的单项目、卡项，如果有则返回true
func (g *GroupBooking) DelItemCheckHasNoFinishGroupRpc(ctx context.Context, args *market.ArgsDelItemCheckHasNoFinishGroup, reply *bool) error {
	return g.Call(ctx, "DelItemCheckHasNoFinishGroupRpc", args, reply)
}

//根据shopIds获取最新的单项目和卡项活动数据
func (g *GroupBooking) GetSingleCardAIProductByShopIdsRpc(ctx context.Context, args *market.ArgsGetSingleCardAIProductByShopIds, reply *market.ReplyGetSingleCardAIProductByShopIds) error {
	return g.Call(ctx, "GetSingleCardAIProductByShopIdsRpc", args, reply)
}

//冻结/释放AI拼团库存，适用于下面情况：（下单支付完成前的时候冻结，订单逾期未支付取消的时候释放）
func (g *GroupBooking) FrozenOrReleaseStock(ctx context.Context, args *market.ArgsFrozenOrReleaseStock, reply *bool) error {
	return g.Call(ctx, "FrozenOrReleaseStock", args, reply)
}

// 门店内活动拼团列表
func (g *GroupBooking) GetShopGroupLists(ctx context.Context, args *market.ArgsShopGroupLists, reply *market.ReplyShopGroupLists) error {
	return g.Call(ctx, "GetShopGroupLists", args, reply)
}

//九百岁首页-懂生活（AI团和优惠体验）
func (g *GroupBooking) GetAIExperienceInfo(ctx context.Context, args *market.EmptyStruct, reply *market.ReplyGetAIExperienceInfo) error {
	return g.Call(ctx, "GetAIExperienceInfo", args, reply)
}
